home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / src / RCS / readcf.c,v < prev    next >
Encoding:
Text File  |  1991-08-06  |  29.9 KB  |  1,600 lines

  1. head    5.21;
  2. branch    5.21.0;
  3. access;
  4. symbols
  5.     RELEASE:5.21.0.13
  6.     BETA:5.21.0.12
  7.     UICSO:5.21.0
  8.     VANILLA:5.21;
  9. locks; strict;
  10. comment    @ * @;
  11.  
  12.  
  13. 5.21
  14. date    90.06.20.08.36.17;    author paul;    state Exp;
  15. branches
  16.     5.21.0.1;
  17. next    ;
  18.  
  19. 5.21.0.1
  20. date    90.06.20.09.43.45;    author paul;    state Exp;
  21. branches;
  22. next    5.21.0.2;
  23.  
  24. 5.21.0.2
  25. date    90.06.23.20.48.37;    author paul;    state Exp;
  26. branches;
  27. next    5.21.0.3;
  28.  
  29. 5.21.0.3
  30. date    90.08.08.11.43.35;    author paul;    state Exp;
  31. branches;
  32. next    5.21.0.4;
  33.  
  34. 5.21.0.4
  35. date    90.10.13.19.02.36;    author paul;    state Exp;
  36. branches;
  37. next    5.21.0.5;
  38.  
  39. 5.21.0.5
  40. date    90.12.21.23.54.32;    author paul;    state Exp;
  41. branches;
  42. next    5.21.0.6;
  43.  
  44. 5.21.0.6
  45. date    91.02.17.05.04.36;    author paul;    state Exp;
  46. branches;
  47. next    5.21.0.7;
  48.  
  49. 5.21.0.7
  50. date    91.03.06.15.15.57;    author paul;    state Exp;
  51. branches;
  52. next    5.21.0.8;
  53.  
  54. 5.21.0.8
  55. date    91.03.20.00.12.13;    author paul;    state Exp;
  56. branches;
  57. next    5.21.0.9;
  58.  
  59. 5.21.0.9
  60. date    91.04.05.06.33.33;    author paul;    state Exp;
  61. branches;
  62. next    5.21.0.10;
  63.  
  64. 5.21.0.10
  65. date    91.04.05.14.55.15;    author paul;    state Exp;
  66. branches;
  67. next    5.21.0.11;
  68.  
  69. 5.21.0.11
  70. date    91.05.18.18.12.08;    author paul;    state Exp;
  71. branches;
  72. next    5.21.0.12;
  73.  
  74. 5.21.0.12
  75. date    91.05.24.22.35.24;    author paul;    state Exp;
  76. branches;
  77. next    5.21.0.13;
  78.  
  79. 5.21.0.13
  80. date    91.06.24.16.20.25;    author paul;    state Exp;
  81. branches;
  82. next    5.21.0.14;
  83.  
  84. 5.21.0.14
  85. date    91.08.05.21.57.56;    author paul;    state Exp;
  86. branches;
  87. next    5.21.0.15;
  88.  
  89. 5.21.0.15
  90. date    91.08.06.18.17.12;    author paul;    state Exp;
  91. branches;
  92. next    ;
  93.  
  94.  
  95. desc
  96. @@
  97.  
  98.  
  99. 5.21
  100. log
  101. @5.64 Berkeley release
  102. @
  103. text
  104. @/*
  105.  * Copyright (c) 1983 Eric P. Allman
  106.  * Copyright (c) 1988 Regents of the University of California.
  107.  * All rights reserved.
  108.  *
  109.  * Redistribution and use in source and binary forms are permitted provided
  110.  * that: (1) source distributions retain this entire copyright notice and
  111.  * comment, and (2) distributions including binaries display the following
  112.  * acknowledgement:  ``This product includes software developed by the
  113.  * University of California, Berkeley and its contributors'' in the
  114.  * documentation or other materials provided with the distribution and in
  115.  * all advertising materials mentioning features or use of this software.
  116.  * Neither the name of the University nor the names of its contributors may
  117.  * be used to endorse or promote products derived from this software without
  118.  * specific prior written permission.
  119.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  120.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  121.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  122.  */
  123.  
  124. #ifndef lint
  125. static char sccsid[] = "@@(#)readcf.c    5.21 (Berkeley) 6/1/90";
  126. #endif /* not lint */
  127.  
  128. # include "sendmail.h"
  129.  
  130. /*
  131. **  READCF -- read control file.
  132. **
  133. **    This routine reads the control file and builds the internal
  134. **    form.
  135. **
  136. **    The file is formatted as a sequence of lines, each taken
  137. **    atomically.  The first character of each line describes how
  138. **    the line is to be interpreted.  The lines are:
  139. **        Dxval        Define macro x to have value val.
  140. **        Cxword        Put word into class x.
  141. **        Fxfile [fmt]    Read file for lines to put into
  142. **                class x.  Use scanf string 'fmt'
  143. **                or "%s" if not present.  Fmt should
  144. **                only produce one string-valued result.
  145. **        Hname: value    Define header with field-name 'name'
  146. **                and value as specified; this will be
  147. **                macro expanded immediately before
  148. **                use.
  149. **        Sn        Use rewriting set n.
  150. **        Rlhs rhs    Rewrite addresses that match lhs to
  151. **                be rhs.
  152. **        Mn arg=val...    Define mailer.  n is the internal name.
  153. **                Args specify mailer parameters.
  154. **        Oxvalue        Set option x to value.
  155. **        Pname=value    Set precedence name to value.
  156. **
  157. **    Parameters:
  158. **        cfname -- control file name.
  159. **
  160. **    Returns:
  161. **        none.
  162. **
  163. **    Side Effects:
  164. **        Builds several internal tables.
  165. */
  166.  
  167. readcf(cfname)
  168.     char *cfname;
  169. {
  170.     FILE *cf;
  171.     int ruleset = 0;
  172.     char *q;
  173.     char **pv;
  174.     struct rewrite *rwp = NULL;
  175.     char buf[MAXLINE];
  176.     register char *p;
  177.     extern char **prescan();
  178.     extern char **copyplist();
  179.     char exbuf[MAXLINE];
  180.     char pvpbuf[PSBUFSIZE];
  181.     extern char *fgetfolded();
  182.     extern char *munchstring();
  183.  
  184.     cf = fopen(cfname, "r");
  185.     if (cf == NULL)
  186.     {
  187.         syserr("cannot open %s", cfname);
  188.         exit(EX_OSFILE);
  189.     }
  190.  
  191.     FileName = cfname;
  192.     LineNumber = 0;
  193.     while (fgetfolded(buf, sizeof buf, cf) != NULL)
  194.     {
  195.         /* map $ into \001 (ASCII SOH) for macro expansion */
  196.         for (p = buf; *p != '\0'; p++)
  197.         {
  198.             if (*p != '$')
  199.                 continue;
  200.  
  201.             if (p[1] == '$')
  202.             {
  203.                 /* actual dollar sign.... */
  204.                 (void) strcpy(p, p + 1);
  205.                 continue;
  206.             }
  207.  
  208.             /* convert to macro expansion character */
  209.             *p = '\001';
  210.         }
  211.  
  212.         /* interpret this line */
  213.         switch (buf[0])
  214.         {
  215.           case '\0':
  216.           case '#':        /* comment */
  217.             break;
  218.  
  219.           case 'R':        /* rewriting rule */
  220.             for (p = &buf[1]; *p != '\0' && *p != '\t'; p++)
  221.                 continue;
  222.  
  223.             if (*p == '\0')
  224.             {
  225.                 syserr("invalid rewrite line \"%s\"", buf);
  226.                 break;
  227.             }
  228.  
  229.             /* allocate space for the rule header */
  230.             if (rwp == NULL)
  231.             {
  232.                 RewriteRules[ruleset] = rwp =
  233.                     (struct rewrite *) xalloc(sizeof *rwp);
  234.             }
  235.             else
  236.             {
  237.                 rwp->r_next = (struct rewrite *) xalloc(sizeof *rwp);
  238.                 rwp = rwp->r_next;
  239.             }
  240.             rwp->r_next = NULL;
  241.  
  242.             /* expand and save the LHS */
  243.             *p = '\0';
  244.             expand(&buf[1], exbuf, &exbuf[sizeof exbuf], CurEnv);
  245.             rwp->r_lhs = prescan(exbuf, '\t', pvpbuf);
  246.             if (rwp->r_lhs != NULL)
  247.                 rwp->r_lhs = copyplist(rwp->r_lhs, TRUE);
  248.  
  249.             /* expand and save the RHS */
  250.             while (*++p == '\t')
  251.                 continue;
  252.             q = p;
  253.             while (*p != '\0' && *p != '\t')
  254.                 p++;
  255.             *p = '\0';
  256.             expand(q, exbuf, &exbuf[sizeof exbuf], CurEnv);
  257.             rwp->r_rhs = prescan(exbuf, '\t', pvpbuf);
  258.             if (rwp->r_rhs != NULL)
  259.                 rwp->r_rhs = copyplist(rwp->r_rhs, TRUE);
  260.             break;
  261.  
  262.           case 'S':        /* select rewriting set */
  263.             ruleset = atoi(&buf[1]);
  264.             if (ruleset >= MAXRWSETS || ruleset < 0)
  265.             {
  266.                 syserr("bad ruleset %d (%d max)", ruleset, MAXRWSETS);
  267.                 ruleset = 0;
  268.             }
  269.             rwp = NULL;
  270.             break;
  271.  
  272.           case 'D':        /* macro definition */
  273.             define(buf[1], newstr(munchstring(&buf[2])), CurEnv);
  274.             break;
  275.  
  276.           case 'H':        /* required header line */
  277.             (void) chompheader(&buf[1], TRUE);
  278.             break;
  279.  
  280.           case 'C':        /* word class */
  281.           case 'F':        /* word class from file */
  282.             /* read list of words from argument or file */
  283.             if (buf[0] == 'F')
  284.             {
  285.                 /* read from file */
  286.                 for (p = &buf[2]; *p != '\0' && !isspace(*p); p++)
  287.                     continue;
  288.                 if (*p == '\0')
  289.                     p = "%s";
  290.                 else
  291.                 {
  292.                     *p = '\0';
  293.                     while (isspace(*++p))
  294.                         continue;
  295.                 }
  296.                 fileclass(buf[1], &buf[2], p);
  297.                 break;
  298.             }
  299.  
  300.             /* scan the list of words and set class for all */
  301.             for (p = &buf[2]; *p != '\0'; )
  302.             {
  303.                 register char *wd;
  304.                 char delim;
  305.  
  306.                 while (*p != '\0' && isspace(*p))
  307.                     p++;
  308.                 wd = p;
  309.                 while (*p != '\0' && !isspace(*p))
  310.                     p++;
  311.                 delim = *p;
  312.                 *p = '\0';
  313.                 if (wd[0] != '\0')
  314.                     setclass(buf[1], wd);
  315.                 *p = delim;
  316.             }
  317.             break;
  318.  
  319.           case 'M':        /* define mailer */
  320.             makemailer(&buf[1]);
  321.             break;
  322.  
  323.           case 'O':        /* set option */
  324.             setoption(buf[1], &buf[2], TRUE, FALSE);
  325.             break;
  326.  
  327.           case 'P':        /* set precedence */
  328.             if (NumPriorities >= MAXPRIORITIES)
  329.             {
  330.                 toomany('P', MAXPRIORITIES);
  331.                 break;
  332.             }
  333.             for (p = &buf[1]; *p != '\0' && *p != '=' && *p != '\t'; p++)
  334.                 continue;
  335.             if (*p == '\0')
  336.                 goto badline;
  337.             *p = '\0';
  338.             Priorities[NumPriorities].pri_name = newstr(&buf[1]);
  339.             Priorities[NumPriorities].pri_val = atoi(++p);
  340.             NumPriorities++;
  341.             break;
  342.  
  343.           case 'T':        /* trusted user(s) */
  344.             p = &buf[1];
  345.             while (*p != '\0')
  346.             {
  347.                 while (isspace(*p))
  348.                     p++;
  349.                 q = p;
  350.                 while (*p != '\0' && !isspace(*p))
  351.                     p++;
  352.                 if (*p != '\0')
  353.                     *p++ = '\0';
  354.                 if (*q == '\0')
  355.                     continue;
  356.                 for (pv = TrustedUsers; *pv != NULL; pv++)
  357.                     continue;
  358.                 if (pv >= &TrustedUsers[MAXTRUST])
  359.                 {
  360.                     toomany('T', MAXTRUST);
  361.                     break;
  362.                 }
  363.                 *pv = newstr(q);
  364.             }
  365.             break;
  366.  
  367.           default:
  368.           badline:
  369.             syserr("unknown control line \"%s\"", buf);
  370.         }
  371.     }
  372.     FileName = NULL;
  373. }
  374. /*
  375. **  TOOMANY -- signal too many of some option
  376. **
  377. **    Parameters:
  378. **        id -- the id of the error line
  379. **        maxcnt -- the maximum possible values
  380. **
  381. **    Returns:
  382. **        none.
  383. **
  384. **    Side Effects:
  385. **        gives a syserr.
  386. */
  387.  
  388. toomany(id, maxcnt)
  389.     char id;
  390.     int maxcnt;
  391. {
  392.     syserr("too many %c lines, %d max", id, maxcnt);
  393. }
  394. /*
  395. **  FILECLASS -- read members of a class from a file
  396. **
  397. **    Parameters:
  398. **        class -- class to define.
  399. **        filename -- name of file to read.
  400. **        fmt -- scanf string to use for match.
  401. **
  402. **    Returns:
  403. **        none
  404. **
  405. **    Side Effects:
  406. **
  407. **        puts all lines in filename that match a scanf into
  408. **            the named class.
  409. */
  410.  
  411. fileclass(class, filename, fmt)
  412.     int class;
  413.     char *filename;
  414.     char *fmt;
  415. {
  416.     FILE *f;
  417.     char buf[MAXLINE];
  418.  
  419.     f = fopen(filename, "r");
  420.     if (f == NULL)
  421.     {
  422.         syserr("cannot open %s", filename);
  423.         return;
  424.     }
  425.  
  426.     while (fgets(buf, sizeof buf, f) != NULL)
  427.     {
  428.         register STAB *s;
  429.         register char *p;
  430. # ifdef SCANF
  431.         char wordbuf[MAXNAME+1];
  432.  
  433.         if (sscanf(buf, fmt, wordbuf) != 1)
  434.             continue;
  435.         p = wordbuf;
  436. # else SCANF
  437.         p = buf;
  438. # endif SCANF
  439.  
  440.         /*
  441.         **  Break up the match into words.
  442.         */
  443.  
  444.         while (*p != '\0')
  445.         {
  446.             register char *q;
  447.  
  448.             /* strip leading spaces */
  449.             while (isspace(*p))
  450.                 p++;
  451.             if (*p == '\0')
  452.                 break;
  453.  
  454.             /* find the end of the word */
  455.             q = p;
  456.             while (*p != '\0' && !isspace(*p))
  457.                 p++;
  458.             if (*p != '\0')
  459.                 *p++ = '\0';
  460.  
  461.             /* enter the word in the symbol table */
  462.             s = stab(q, ST_CLASS, ST_ENTER);
  463.             setbitn(class, s->s_class);
  464.         }
  465.     }
  466.  
  467.     (void) fclose(f);
  468. }
  469. /*
  470. **  MAKEMAILER -- define a new mailer.
  471. **
  472. **    Parameters:
  473. **        line -- description of mailer.  This is in labeled
  474. **            fields.  The fields are:
  475. **               P -- the path to the mailer
  476. **               F -- the flags associated with the mailer
  477. **               A -- the argv for this mailer
  478. **               S -- the sender rewriting set
  479. **               R -- the recipient rewriting set
  480. **               E -- the eol string
  481. **            The first word is the canonical name of the mailer.
  482. **
  483. **    Returns:
  484. **        none.
  485. **
  486. **    Side Effects:
  487. **        enters the mailer into the mailer table.
  488. */
  489.  
  490. makemailer(line)
  491.     char *line;
  492. {
  493.     register char *p;
  494.     register struct mailer *m;
  495.     register STAB *s;
  496.     int i;
  497.     char fcode;
  498.     extern int NextMailer;
  499.     extern char **makeargv();
  500.     extern char *munchstring();
  501.     extern char *DelimChar;
  502.     extern long atol();
  503.  
  504.     /* allocate a mailer and set up defaults */
  505.     m = (struct mailer *) xalloc(sizeof *m);
  506.     bzero((char *) m, sizeof *m);
  507.     m->m_mno = NextMailer;
  508.     m->m_eol = "\n";
  509.  
  510.     /* collect the mailer name */
  511.     for (p = line; *p != '\0' && *p != ',' && !isspace(*p); p++)
  512.         continue;
  513.     if (*p != '\0')
  514.         *p++ = '\0';
  515.     m->m_name = newstr(line);
  516.  
  517.     /* now scan through and assign info from the fields */
  518.     while (*p != '\0')
  519.     {
  520.         while (*p != '\0' && (*p == ',' || isspace(*p)))
  521.             p++;
  522.  
  523.         /* p now points to field code */
  524.         fcode = *p;
  525.         while (*p != '\0' && *p != '=' && *p != ',')
  526.             p++;
  527.         if (*p++ != '=')
  528.         {
  529.             syserr("`=' expected");
  530.             return;
  531.         }
  532.         while (isspace(*p))
  533.             p++;
  534.  
  535.         /* p now points to the field body */
  536.         p = munchstring(p);
  537.  
  538.         /* install the field into the mailer struct */
  539.         switch (fcode)
  540.         {
  541.           case 'P':        /* pathname */
  542.             m->m_mailer = newstr(p);
  543.             break;
  544.  
  545.           case 'F':        /* flags */
  546.             for (; *p != '\0'; p++)
  547.                 setbitn(*p, m->m_flags);
  548.             break;
  549.  
  550.           case 'S':        /* sender rewriting ruleset */
  551.           case 'R':        /* recipient rewriting ruleset */
  552.             i = atoi(p);
  553.             if (i < 0 || i >= MAXRWSETS)
  554.             {
  555.                 syserr("invalid rewrite set, %d max", MAXRWSETS);
  556.                 return;
  557.             }
  558.             if (fcode == 'S')
  559.                 m->m_s_rwset = i;
  560.             else
  561.                 m->m_r_rwset = i;
  562.             break;
  563.  
  564.           case 'E':        /* end of line string */
  565.             m->m_eol = newstr(p);
  566.             break;
  567.  
  568.           case 'A':        /* argument vector */
  569.             m->m_argv = makeargv(p);
  570.             break;
  571.  
  572.           case 'M':        /* maximum message size */
  573.             m->m_maxsize = atol(p);
  574.             break;
  575.         }
  576.  
  577.         p = DelimChar;
  578.     }
  579.  
  580.     /* now store the mailer away */
  581.     if (NextMailer >= MAXMAILERS)
  582.     {
  583.         syserr("too many mailers defined (%d max)", MAXMAILERS);
  584.         return;
  585.     }
  586.     Mailer[NextMailer++] = m;
  587.     s = stab(m->m_name, ST_MAILER, ST_ENTER);
  588.     s->s_mailer = m;
  589. }
  590. /*
  591. **  MUNCHSTRING -- translate a string into internal form.
  592. **
  593. **    Parameters:
  594. **        p -- the string to munch.
  595. **
  596. **    Returns:
  597. **        the munched string.
  598. **
  599. **    Side Effects:
  600. **        Sets "DelimChar" to point to the string that caused us
  601. **        to stop.
  602. */
  603.  
  604. char *
  605. munchstring(p)
  606.     register char *p;
  607. {
  608.     register char *q;
  609.     bool backslash = FALSE;
  610.     bool quotemode = FALSE;
  611.     static char buf[MAXLINE];
  612.     extern char *DelimChar;
  613.  
  614.     for (q = buf; *p != '\0'; p++)
  615.     {
  616.         if (backslash)
  617.         {
  618.             /* everything is roughly literal */
  619.             backslash = FALSE;
  620.             switch (*p)
  621.             {
  622.               case 'r':        /* carriage return */
  623.                 *q++ = '\r';
  624.                 continue;
  625.  
  626.               case 'n':        /* newline */
  627.                 *q++ = '\n';
  628.                 continue;
  629.  
  630.               case 'f':        /* form feed */
  631.                 *q++ = '\f';
  632.                 continue;
  633.  
  634.               case 'b':        /* backspace */
  635.                 *q++ = '\b';
  636.                 continue;
  637.             }
  638.             *q++ = *p;
  639.         }
  640.         else
  641.         {
  642.             if (*p == '\\')
  643.                 backslash = TRUE;
  644.             else if (*p == '"')
  645.                 quotemode = !quotemode;
  646.             else if (quotemode || *p != ',')
  647.                 *q++ = *p;
  648.             else
  649.                 break;
  650.         }
  651.     }
  652.  
  653.     DelimChar = p;
  654.     *q++ = '\0';
  655.     return (buf);
  656. }
  657. /*
  658. **  MAKEARGV -- break up a string into words
  659. **
  660. **    Parameters:
  661. **        p -- the string to break up.
  662. **
  663. **    Returns:
  664. **        a char **argv (dynamically allocated)
  665. **
  666. **    Side Effects:
  667. **        munges p.
  668. */
  669.  
  670. char **
  671. makeargv(p)
  672.     register char *p;
  673. {
  674.     char *q;
  675.     int i;
  676.     char **avp;
  677.     char *argv[MAXPV + 1];
  678.  
  679.     /* take apart the words */
  680.     i = 0;
  681.     while (*p != '\0' && i < MAXPV)
  682.     {
  683.         q = p;
  684.         while (*p != '\0' && !isspace(*p))
  685.             p++;
  686.         while (isspace(*p))
  687.             *p++ = '\0';
  688.         argv[i++] = newstr(q);
  689.     }
  690.     argv[i++] = NULL;
  691.  
  692.     /* now make a copy of the argv */
  693.     avp = (char **) xalloc(sizeof *avp * i);
  694.     bcopy((char *) argv, (char *) avp, sizeof *avp * i);
  695.  
  696.     return (avp);
  697. }
  698. /*
  699. **  PRINTRULES -- print rewrite rules (for debugging)
  700. **
  701. **    Parameters:
  702. **        none.
  703. **
  704. **    Returns:
  705. **        none.
  706. **
  707. **    Side Effects:
  708. **        prints rewrite rules.
  709. */
  710.  
  711. printrules()
  712. {
  713.     register struct rewrite *rwp;
  714.     register int ruleset;
  715.  
  716.     for (ruleset = 0; ruleset < 10; ruleset++)
  717.     {
  718.         if (RewriteRules[ruleset] == NULL)
  719.             continue;
  720.         printf("\n----Rule Set %d:", ruleset);
  721.  
  722.         for (rwp = RewriteRules[ruleset]; rwp != NULL; rwp = rwp->r_next)
  723.         {
  724.             printf("\nLHS:");
  725.             printav(rwp->r_lhs);
  726.             printf("RHS:");
  727.             printav(rwp->r_rhs);
  728.         }
  729.     }
  730. }
  731.  
  732. /*
  733. **  SETOPTION -- set global processing option
  734. **
  735. **    Parameters:
  736. **        opt -- option name.
  737. **        val -- option value (as a text string).
  738. **        safe -- set if this came from a configuration file.
  739. **            Some options (if set from the command line) will
  740. **            reset the user id to avoid security problems.
  741. **        sticky -- if set, don't let other setoptions override
  742. **            this value.
  743. **
  744. **    Returns:
  745. **        none.
  746. **
  747. **    Side Effects:
  748. **        Sets options as implied by the arguments.
  749. */
  750.  
  751. static BITMAP    StickyOpt;        /* set if option is stuck */
  752. extern char    *NetName;        /* name of home (local) network */
  753.  
  754. setoption(opt, val, safe, sticky)
  755.     char opt;
  756.     char *val;
  757.     bool safe;
  758.     bool sticky;
  759. {
  760.     extern bool atobool();
  761.     extern time_t convtime();
  762.     extern int QueueLA;
  763.     extern int RefuseLA;
  764.     extern bool trusteduser();
  765.     extern char *username();
  766.  
  767.     if (tTd(37, 1))
  768.         printf("setoption %c=%s", opt, val);
  769.  
  770.     /*
  771.     **  See if this option is preset for us.
  772.     */
  773.  
  774.     if (bitnset(opt, StickyOpt))
  775.     {
  776.         if (tTd(37, 1))
  777.             printf(" (ignored)\n");
  778.         return;
  779.     }
  780.  
  781.     /*
  782.     **  Check to see if this option can be specified by this user.
  783.     */
  784.  
  785.     if (!safe && getuid() == 0)
  786.         safe = TRUE;
  787.     if (!safe && index("deiLmorsv", opt) == NULL)
  788.     {
  789.         if (opt != 'M' || (val[0] != 'r' && val[0] != 's'))
  790.         {
  791.             if (tTd(37, 1))
  792.                 printf(" (unsafe)");
  793.             if (getuid() != geteuid())
  794.             {
  795.                 printf("(Resetting uid)\n");
  796.                 (void) setgid(getgid());
  797.                 (void) setuid(getuid());
  798.             }
  799.         }
  800.     }
  801.     else if (tTd(37, 1))
  802.         printf("\n");
  803.  
  804.     switch (opt)
  805.     {
  806.       case 'A':        /* set default alias file */
  807.         if (val[0] == '\0')
  808.             AliasFile = "aliases";
  809.         else
  810.             AliasFile = newstr(val);
  811.         break;
  812.  
  813.       case 'a':        /* look N minutes for "@@:@@" in alias file */
  814.         if (val[0] == '\0')
  815.             SafeAlias = 5;
  816.         else
  817.             SafeAlias = atoi(val);
  818.         break;
  819.  
  820.       case 'B':        /* substitution for blank character */
  821.         SpaceSub = val[0];
  822.         if (SpaceSub == '\0')
  823.             SpaceSub = ' ';
  824.         break;
  825.  
  826.       case 'c':        /* don't connect to "expensive" mailers */
  827.         NoConnect = atobool(val);
  828.         break;
  829.  
  830.       case 'C':        /* checkpoint after N connections */
  831.         CheckPointLimit = atoi(val);
  832.         break;
  833.  
  834.       case 'd':        /* delivery mode */
  835.         switch (*val)
  836.         {
  837.           case '\0':
  838.             SendMode = SM_DELIVER;
  839.             break;
  840.  
  841.           case SM_QUEUE:    /* queue only */
  842. #ifndef QUEUE
  843.             syserr("need QUEUE to set -odqueue");
  844. #endif QUEUE
  845.             /* fall through..... */
  846.  
  847.           case SM_DELIVER:    /* do everything */
  848.           case SM_FORK:        /* fork after verification */
  849.             SendMode = *val;
  850.             break;
  851.  
  852.           default:
  853.             syserr("Unknown delivery mode %c", *val);
  854.             exit(EX_USAGE);
  855.         }
  856.         break;
  857.  
  858.       case 'D':        /* rebuild alias database as needed */
  859.         AutoRebuild = atobool(val);
  860.         break;
  861.  
  862.       case 'e':        /* set error processing mode */
  863.         switch (*val)
  864.         {
  865.           case EM_QUIET:    /* be silent about it */
  866.           case EM_MAIL:        /* mail back */
  867.           case EM_BERKNET:    /* do berknet error processing */
  868.           case EM_WRITE:    /* write back (or mail) */
  869.             HoldErrs = TRUE;
  870.             /* fall through... */
  871.  
  872.           case EM_PRINT:    /* print errors normally (default) */
  873.             ErrorMode = *val;
  874.             break;
  875.         }
  876.         break;
  877.  
  878.       case 'F':        /* file mode */
  879.         FileMode = atooct(val) & 0777;
  880.         break;
  881.  
  882.       case 'f':        /* save Unix-style From lines on front */
  883.         SaveFrom = atobool(val);
  884.         break;
  885.  
  886.       case 'g':        /* default gid */
  887.         DefGid = atoi(val);
  888.         break;
  889.  
  890.       case 'H':        /* help file */
  891.         if (val[0] == '\0')
  892.             HelpFile = "sendmail.hf";
  893.         else
  894.             HelpFile = newstr(val);
  895.         break;
  896.  
  897.       case 'I':        /* use internet domain name server */
  898.         UseNameServer = atobool(val);
  899.         break;
  900.  
  901.       case 'i':        /* ignore dot lines in message */
  902.         IgnrDot = atobool(val);
  903.         break;
  904.  
  905.       case 'L':        /* log level */
  906.         LogLevel = atoi(val);
  907.         break;
  908.  
  909.       case 'M':        /* define macro */
  910.         define(val[0], newstr(&val[1]), CurEnv);
  911.         sticky = FALSE;
  912.         break;
  913.  
  914.       case 'm':        /* send to me too */
  915.         MeToo = atobool(val);
  916.         break;
  917.  
  918.       case 'n':        /* validate RHS in newaliases */
  919.         CheckAliases = atobool(val);
  920.         break;
  921.  
  922. # ifdef DAEMON
  923.       case 'N':        /* home (local?) network name */
  924.         NetName = newstr(val);
  925.         break;
  926. # endif DAEMON
  927.  
  928.       case 'o':        /* assume old style headers */
  929.         if (atobool(val))
  930.             CurEnv->e_flags |= EF_OLDSTYLE;
  931.         else
  932.             CurEnv->e_flags &= ~EF_OLDSTYLE;
  933.         break;
  934.  
  935.       case 'P':        /* postmaster copy address for returned mail */
  936.         PostMasterCopy = newstr(val);
  937.         break;
  938.  
  939.       case 'q':        /* slope of queue only function */
  940.         QueueFactor = atoi(val);
  941.         break;
  942.  
  943.       case 'Q':        /* queue directory */
  944.         if (val[0] == '\0')
  945.             QueueDir = "mqueue";
  946.         else
  947.             QueueDir = newstr(val);
  948.         break;
  949.  
  950.       case 'r':        /* read timeout */
  951.         ReadTimeout = convtime(val);
  952.         break;
  953.  
  954.       case 'S':        /* status file */
  955.         if (val[0] == '\0')
  956.             StatFile = "sendmail.st";
  957.         else
  958.             StatFile = newstr(val);
  959.         break;
  960.  
  961.       case 's':        /* be super safe, even if expensive */
  962.         SuperSafe = atobool(val);
  963.         break;
  964.  
  965.       case 'T':        /* queue timeout */
  966.         TimeOut = convtime(val);
  967.         /*FALLTHROUGH*/
  968.  
  969.       case 't':        /* time zone name */
  970.         break;
  971.  
  972.       case 'u':        /* set default uid */
  973.         DefUid = atoi(val);
  974.         setdefuser();
  975.         break;
  976.  
  977.       case 'v':        /* run in verbose mode */
  978.         Verbose = atobool(val);
  979.         break;
  980.  
  981.       case 'x':        /* load avg at which to auto-queue msgs */
  982.         QueueLA = atoi(val);
  983.         break;
  984.  
  985.       case 'X':        /* load avg at which to auto-reject connections */
  986.         RefuseLA = atoi(val);
  987.         break;
  988.  
  989.       case 'y':        /* work recipient factor */
  990.         WkRecipFact = atoi(val);
  991.         break;
  992.  
  993.       case 'Y':        /* fork jobs during queue runs */
  994.         ForkQueueRuns = atobool(val);
  995.         break;
  996.  
  997.       case 'z':        /* work message class factor */
  998.         WkClassFact = atoi(val);
  999.         break;
  1000.  
  1001.       case 'Z':        /* work time factor */
  1002.         WkTimeFact = atoi(val);
  1003.         break;
  1004.  
  1005.       default:
  1006.         break;
  1007.     }
  1008.     if (sticky)
  1009.         setbitn(opt, StickyOpt);
  1010.     return;
  1011. }
  1012. /*
  1013. **  SETCLASS -- set a word into a class
  1014. **
  1015. **    Parameters:
  1016. **        class -- the class to put the word in.
  1017. **        word -- the word to enter
  1018. **
  1019. **    Returns:
  1020. **        none.
  1021. **
  1022. **    Side Effects:
  1023. **        puts the word into the symbol table.
  1024. */
  1025.  
  1026. setclass(class, word)
  1027.     int class;
  1028.     char *word;
  1029. {
  1030.     register STAB *s;
  1031.  
  1032.     s = stab(word, ST_CLASS, ST_ENTER);
  1033.     setbitn(class, s->s_class);
  1034. }
  1035. @
  1036.  
  1037.  
  1038. 5.21.0.1
  1039. log
  1040. @IDA patches
  1041. @
  1042. text
  1043. @d316 1
  1044. a316 4
  1045.     if (filename[0] == '|')
  1046.         f = popen(&filename[1], "r");
  1047.     else
  1048.         f = fopen(filename, "r");
  1049. d333 1
  1050. a333 1
  1051. # else /* !SCANF */
  1052. d335 1
  1053. a335 1
  1054. # endif /* SCANF */
  1055. d364 1
  1056. a364 4
  1057.     if (filename[0] == '|')
  1058.         (void) pclose(f);
  1059.     else
  1060.           (void) fclose(f);
  1061. d447 2
  1062. a448 2
  1063.           case 'S':        /* sender rewriting ruleset(s) */
  1064.           case 'R':        /* recipient rewriting ruleset(s) */
  1065. a454 20
  1066.             /* default envelope ruleset for header ruleset */
  1067.             if (fcode == 'S') {
  1068.                 m->m_se_rwset = i;
  1069.                 m->m_sh_rwset = i;
  1070.             }
  1071.             else
  1072.             {
  1073.                 m->m_re_rwset = i;
  1074.                 m->m_rh_rwset = i;
  1075.             }
  1076.             /* look for specific header rewriting ruleset */
  1077.             while (*p != '\0' && *p != ',' && *p != '/') p++;
  1078.             if (*p++ == '/') {
  1079.                 i = atoi(p);
  1080.                 if (i < 0 || i >= MAXRWSETS)
  1081.                 {
  1082.                     syserr("invalid rewrite set, %d max",
  1083.                            MAXRWSETS);
  1084.                     return;
  1085.                 }
  1086. d456 1
  1087. a456 1
  1088.                     m->m_sh_rwset = i;
  1089. d458 1
  1090. a458 2
  1091.                     m->m_rh_rwset = i;
  1092.             }
  1093. d741 1
  1094. a741 1
  1095. #endif /* QUEUE */
  1096. a756 14
  1097. #if defined(apollo)
  1098.         /*
  1099.          * Apollo cannot handle multiple processes (perhaps on
  1100.          * separate nodes) opening the alias database read-write.
  1101.          * So we open it readonly except in INITALIAS mode
  1102.          * (see mapinit() in daemon.c).  This makes AutoRebuild
  1103.          * impossible.
  1104.          */
  1105.         if (AutoRebuild)
  1106.         {
  1107.             syserr("Alias autorebuild (option D) not supported on Apollo");
  1108.             exit(EX_USAGE);
  1109.         }
  1110. #endif /* apollo */
  1111. d801 1
  1112. a801 6
  1113. # if defined(NDBM) || defined(SDBM)
  1114.       case 'K':        /* keyed database file */
  1115.         if (*val != '\0')
  1116.             DbmTab[*val & 0177].db_name = newstr(&val[1]);
  1117.         break;
  1118. # endif /* NDBM || SDBM */
  1119. d823 1
  1120. a823 1
  1121. # endif /* DAEMON */
  1122. a899 4
  1123.         break;
  1124.  
  1125.       case '/':        /* use split envelope/header rewriting */
  1126.         SplitRewriting = TRUE;
  1127. @
  1128.  
  1129.  
  1130. 5.21.0.2
  1131. log
  1132. @Added FILE *popen() declaration.
  1133. @
  1134. text
  1135. @d313 1
  1136. a313 1
  1137.     FILE *f, *popen();
  1138. @
  1139.  
  1140.  
  1141. 5.21.0.3
  1142. log
  1143. @Now allows space characters in classes initialized via commands ala
  1144. FH|ypcat hosts.
  1145. @
  1146. text
  1147. @d187 1
  1148. a187 3
  1149.  
  1150.                 /* don't truncate pipe strings */
  1151.                 else if (buf[2] != '|')
  1152. @
  1153.  
  1154.  
  1155. 5.21.0.4
  1156. log
  1157. @Fixed fencepost bug in third expand() argument.  Re-did #if sstatements for
  1158. alternative dbm packages.
  1159. @
  1160. text
  1161. @a87 1
  1162.     setdefuser();
  1163. d141 1
  1164. a141 1
  1165.             expand(&buf[1], exbuf, &exbuf[(sizeof(exbuf)-1)], CurEnv);
  1166. d153 1
  1167. a153 1
  1168.             expand(q, exbuf, &exbuf[(sizeof(exbuf)-1)], CurEnv);
  1169. d844 1
  1170. a844 1
  1171. # if defined(NDBM) || defined(OTHERDBM)
  1172. d849 1
  1173. a849 1
  1174. # endif /* NDBM || OTHERDBM */
  1175. @
  1176.  
  1177.  
  1178. 5.21.0.5
  1179. log
  1180. @Streamlined the reading of class members from files & pipes.  Files may
  1181. use the sscanf() convention now w.o. #define'ing SCANF.  From a suggestion
  1182. from Piet Beertema (piet@@mcsun.eu.net).
  1183. @
  1184. text
  1185. @a182 8
  1186.                 /* read from pipe */
  1187.                 if (buf[2] == '|')
  1188.                 {
  1189.                     p = "%s";
  1190.                     fileclass(buf[1], &buf[2], p);
  1191.                     break;
  1192.                 }
  1193.                     
  1194. d188 3
  1195. a190 1
  1196.                 else
  1197. d333 1
  1198. d339 3
  1199. a364 2
  1200.             if (tTd(37, 2))
  1201.                 printf("%s added to class %d\n", q, class);
  1202. @
  1203.  
  1204.  
  1205. 5.21.0.6
  1206. log
  1207. @Added static keyword to declaration of munchstring(), fileclass(),
  1208. makemailer(), toomany(),  and makeargv().
  1209. @
  1210. text
  1211. @d79 1
  1212. a79 2
  1213.     static char *munchstring();
  1214.     static fileclass(), makemailer(), toomany();
  1215. a293 1
  1216. static
  1217. a316 1
  1218. static
  1219. a399 1
  1220. static
  1221. d409 2
  1222. a410 2
  1223.     static char **makeargv();
  1224.     static char *munchstring();
  1225. d535 1
  1226. a535 1
  1227. static char *
  1228. d601 1
  1229. a601 1
  1230. static char **
  1231. d695 1
  1232. @
  1233.  
  1234.  
  1235. 5.21.0.7
  1236. log
  1237. @ANSIfied.
  1238. @
  1239. text
  1240. @d25 1
  1241. a25 1
  1242. #include "sendmail.h"
  1243. a26 18
  1244. #ifdef __STDC__
  1245. # ifdef    CC_WONT_PROMOTE
  1246. static void toomany(char, int);
  1247. # else    /* !CC_WONT_PROMOTE */
  1248. static void toomany(int, int);
  1249. # endif    /* CC_WONT_PROMOTE */
  1250. static void fileclass(int, char *, const char *);
  1251. static void makemailer(char *);
  1252. static char * munchstring(char *);
  1253. static char ** makeargv(char *);
  1254. #else /* !__STDC__ */
  1255. static void toomany();
  1256. static void fileclass();
  1257. static void makemailer();
  1258. static char * munchstring();
  1259. static char ** makeargv();
  1260. #endif /* __STDC__ */
  1261.  
  1262. a63 1
  1263. void
  1264. d74 2
  1265. d78 3
  1266. d295 1
  1267. a295 1
  1268. static void
  1269. d319 1
  1270. a319 1
  1271. static void
  1272. d323 1
  1273. a323 1
  1274.     const char *fmt;
  1275. d403 1
  1276. a403 1
  1277. static void
  1278. d413 2
  1279. d416 1
  1280. a645 1
  1281. void
  1282. a688 1
  1283. void
  1284. d691 1
  1285. a691 1
  1286.     const char *val;
  1287. d695 2
  1288. d699 1
  1289. a982 1
  1290. void
  1291. d985 1
  1292. a985 1
  1293.     const char *word;
  1294. @
  1295.  
  1296.  
  1297. 5.21.0.8
  1298. log
  1299. @Pass 'C' class definition lines through expand() to expand any macros.
  1300. @
  1301. text
  1302. @d222 1
  1303. a222 2
  1304.             expand(&buf[2], exbuf, &exbuf[(sizeof(exbuf)-1)], CurEnv);
  1305.             for (p = exbuf; *p != '\0'; )
  1306. a999 2
  1307.     if (tTd(37, 2))
  1308.         printf("%s added to class %d\n", word, class);
  1309. @
  1310.  
  1311.  
  1312. 5.21.0.9
  1313. log
  1314. @Character set translation changes adapted from patches from Keld Simonsen
  1315. (keld@@dkuug.dk).
  1316. @
  1317. text
  1318. @a408 3
  1319. **               M -- the maximum message size
  1320. **               C -- the default character set (#if BIT8)
  1321. **               X -- the default escape char (#if BIT8)
  1322. d485 1
  1323. a485 2
  1324.             if (fcode == 'S')
  1325.             {
  1326. d496 1
  1327. a496 2
  1328.             if (*p++ == '/')
  1329.             {
  1330. d522 1
  1331. a522 4
  1332. #ifdef BIT8
  1333.           case 'C':        /* default character set */
  1334.             m->m_charset = getchset(newstr(p), 0);
  1335.             break;
  1336. a523 5
  1337.           case 'X':        /* default escape char */
  1338.             m->m_esc = atol(p);
  1339.             break;
  1340. #endif /* BIT8 */
  1341.         }
  1342. a525 4
  1343. #ifdef BIT8
  1344.     if (m->m_charset)
  1345.         m->m_charset->esc = m->m_esc;
  1346. #endif /* BIT8 */
  1347. @
  1348.  
  1349.  
  1350. 5.21.0.10
  1351. log
  1352. @Added RCS ID string
  1353. @
  1354. text
  1355. @a22 1
  1356. static char  rcsid[] = "@@(#)$Id$";
  1357. @
  1358.  
  1359.  
  1360. 5.21.0.11
  1361. log
  1362. @System 5 and general improvement patches contributed by Bruce Lilly
  1363. (bruce%balilly@@broadcast.sony.com).
  1364. @
  1365. text
  1366. @d22 2
  1367. a23 2
  1368. static char sccsid[] = "@@(#)readcf.c    5.21 (Berkeley) 6/1/90    %I% local";
  1369. static char  rcsid[] = "@@(#)$Id: readcf.c,v 5.21.0.10 1991/04/05 14:55:15 paul Exp paul $";
  1370. d341 1
  1371. a341 1
  1372.     FILE *f;
  1373. @
  1374.  
  1375.  
  1376. 5.21.0.12
  1377. log
  1378. @First pass at adding Bruce Lilly's database auto-build code.
  1379. @
  1380. text
  1381. @d23 1
  1382. a23 1
  1383. static char  rcsid[] = "@@(#)$Id: readcf.c,v 5.21.0.11 1991/05/18 18:12:08 paul Exp paul $";
  1384. d29 1
  1385. a29 1
  1386. # ifdef CC_WONT_PROMOTE
  1387. a773 4
  1388. #if defined(DBM_AUTOBUILD) && (defined(NDBM) || defined(OTHERDBM) )
  1389.         DbmTab[DB_ALIAS].db_source = DbmTab[DB_ALIAS].db_name;
  1390.         DbmTab[DB_ALIAS].db_rule = "%99[^#:]:%199[ -~    ]\n";
  1391. #endif /* DBM_AUTOBUILD && (NDBM || OTHERDBM) */
  1392. d881 1
  1393. a881 1
  1394. #if defined(NDBM) || defined(OTHERDBM)
  1395. a882 1
  1396. # ifndef DBM_AUTOBUILD
  1397. a884 128
  1398. # else /* DBM_AUTOBUILD */
  1399.         if (*val != '\0')
  1400.         {
  1401.             char *p;
  1402.  
  1403.             p = strtok(val+1, " \t"); /* beware the macro newstr */
  1404.             DbmTab[*val & 0177].db_name = newstr(p);
  1405.             if ((p = strtok((char *)NULL, " \t")) && (*p == '/'))
  1406.                 DbmTab[*val & 0177].db_source = newstr(p);
  1407.             else
  1408.             {
  1409.                 DbmTab[*val & 0177].db_source = (char *)NULL;
  1410.                 if (!p)
  1411.                     break; /* we're outta here */
  1412.             }
  1413.             if (p = strtok((char *)NULL, ""))
  1414.             {
  1415.                 /*
  1416.                  * start of the rest of the string, or NULL
  1417.                  */
  1418.  
  1419.                 /* fix \-escapes */
  1420.                 char    *s;
  1421.  
  1422.                 for (s = p ; *s; s++)
  1423.                 {
  1424.                     if (*s == '\\')
  1425.                     {
  1426.                         char *t, *u;
  1427.  
  1428.                         u = t = s+1;
  1429.                         switch (*t)
  1430.                         {
  1431. #  ifdef __STDC__
  1432.                             case 'a':
  1433.                             *s = '\a';
  1434.                             u++;
  1435.                             break;
  1436. #  endif /* __STDC__ */
  1437.                             case 'b':
  1438.                             *s = '\b';
  1439.                             u++;
  1440.                             break;
  1441.  
  1442.                             case 'f':
  1443.                             *s = '\f';
  1444.                             u++;
  1445.                             break;
  1446.  
  1447.                             case 'n':
  1448.                             *s = '\n';
  1449.                             u++;
  1450.                             break;
  1451.  
  1452.                             case 'r':
  1453.                             *s = '\r';
  1454.                             u++;
  1455.                             break;
  1456.  
  1457.                             case 't':
  1458.                             *s = '\t';
  1459.                             u++;
  1460.                             break;
  1461. #  ifdef __STDC__
  1462.                             case 'v':
  1463.                             *s = '\v';
  1464.                             u++;
  1465.                             break;
  1466. #  endif /* __STDC__ */
  1467. #  ifdef __STDC__
  1468.                             case 'x':
  1469.                             {
  1470.                                 long x;
  1471.  
  1472.                                 x = strtol(u, &u, 16);
  1473.                                 while (x > 255)
  1474.                                     x /= 255;
  1475.                                 *s = (char)x;
  1476.                                 u++;
  1477.                             }
  1478.                             break;
  1479. #  endif /* __STDC__ */
  1480.                             case '0':
  1481.                             case '1':
  1482.                             case '2':
  1483.                             case '3':
  1484.                             case '4':
  1485.                             case '5':
  1486.                             case '6':
  1487.                             case '7':
  1488.                             *s = '\0';
  1489.                             for ( ; ((u-t)<3) && *u && (*u >= '0') && (*u <= '7') ; u++)
  1490.                                 *s = (*s * 8)%249 + (*u - '0');
  1491.                             break;
  1492.  
  1493.                             case '\\':    /* do nothing */
  1494.                         /*FALLTHROUGH*/
  1495. #  ifdef __STDC__
  1496.                             case '?':    /* do nothing */
  1497.                         /*FALLTHROUGH*/
  1498. #  endif /* __STDC__ */
  1499.                             case '\'':    /* do nothing */
  1500.                         /*FALLTHROUGH*/
  1501. #  ifdef __STDC__
  1502.                             case '"':    /* do nothing */
  1503.                         /*FALLTHROUGH*/
  1504. #  endif /* __STDC__ */
  1505.                             default:
  1506.                             *s = *t;
  1507.                             u++;
  1508.                             break;
  1509.                         }
  1510.                         /* left shift rest of string */
  1511.                         while (*u)
  1512.                             *t++ = *u++;
  1513.                         *t = '\0';
  1514.                     }
  1515.                 }
  1516.                 DbmTab[*val & 0177].db_rule = newstr(p);
  1517.             }
  1518.             else    /* have a source file but no program or string */
  1519.                 DbmTab[*val & 0177].db_rule = "%99[^:#     ]:%199[ -~    ]\n";
  1520.             if (tTd(37, 1))
  1521.                 printf("db_rule = %s\n", DbmTab[*val & 0177].db_rule);
  1522.             if ((!DbmTab[*val & 0177].db_source) && (DbmTab[*val & 0177].db_rule[0] != '|'))
  1523.                 DbmTab[*val & 0177].db_source = DbmTab[*val & 0177].db_name;
  1524.         }
  1525. # endif /* !DBM_AUTOBUILD */
  1526. d886 1
  1527. a886 1
  1528. #endif /* NDBM || OTHERDBM */
  1529. @
  1530.  
  1531.  
  1532. 5.21.0.13
  1533. log
  1534. @Deleted NetName (N command line argument).
  1535. @
  1536. text
  1537. @d22 2
  1538. a23 2
  1539. static char sccsid[] = "@@(#)readcf.c    5.21 (Berkeley) 6/1/90";
  1540. static char  rcsid[] = "@@(#)$Id: readcf.c,v 5.21.0.12 1991/05/24 22:35:24 paul Exp paul $";
  1541. d718 1
  1542. d1037 1
  1543. d1039 1
  1544. a1039 3
  1545. # ifdef LOG
  1546.         syslog(LOG_ERR, "'%c' option is obsolete", opt);
  1547. # endif /* LOG */
  1548. d1041 1
  1549. @
  1550.  
  1551.  
  1552. 5.21.0.14
  1553. log
  1554. @Replaced syslog() with syserr() in reporting obsolete 'N' option.
  1555. Using syslog() before sendmail.fc is created sets a syslog state variable
  1556. that's not restored after a thaw leading to very strange behavior.
  1557. Reported by  Nick Sayer and Neil Rickert.
  1558. @
  1559. text
  1560. @d23 1
  1561. a23 1
  1562. static char  rcsid[] = "@@(#)$Id: readcf.c,v 5.21.0.13 1991/06/24 16:20:25 paul Exp paul $";
  1563. d1037 3
  1564. a1039 1
  1565.         syserr("Option N is obsolete (ON in sendmail.cf or -oN on command line)");
  1566. @
  1567.  
  1568.  
  1569. 5.21.0.15
  1570. log
  1571. @Date:    Wed, 31 Jul 91 13:24:05 -0500
  1572. To:      Paul Pomes <Paul-Pomes@@uiuc.edu>
  1573. cc:      "Mark D. Baushke" <mdb@@esd.3com.com>
  1574. From:    Neil Rickert <rickert@@cs.niu.edu>
  1575. Subject: patches / bugs in sendmail-IDA.
  1576.  
  1577. I am enclosing the patch I prepared for a few users who were having problems
  1578. with frozen config files on Suns, in spite of static linking and using
  1579. ../uiuc/malloc.c .
  1580.  
  1581. It eliminates any code that even smells of YP/NIS prior to the completion of
  1582. freeze/thaw operations.
  1583.  
  1584. It is probably safe, and perhaps even desirable, to remove the yp_unbind()
  1585. calls from main.c
  1586.  
  1587.  -Neil
  1588. @
  1589. text
  1590. @d23 1
  1591. a23 1
  1592. static char  rcsid[] = "@@(#)$Id: readcf.c,v 5.21.0.14 1991/08/05 21:57:56 paul Exp paul $";
  1593. d104 1
  1594. a104 1
  1595.     /* setdefuser(); Moved to main.c - see comments there */
  1596. d1086 1
  1597. a1086 1
  1598.         /* setdefuser(); Moved to main.c - see comments there */
  1599. @
  1600.